package com.stream;

import java.util.stream.IntStream;

public class Sum {
	public static void main(String[] args) {
		int[] nums = {1,2,3};
		//int sum = IntStream.of(nums).map(i->i*3).sum();
		int sum = IntStream.of(nums).map(Sum::doubleNum).sum();
		System.out.println(sum);
		IntStream.of(nums).map(Sum::doubleNum);
	}
	public static int doubleNum(int i){
		System.out.println("执行乘以4操作");
		return i*4;
	}
}
